#include "TreeItem.h"
#include "../../core/src/container/Attribute.h"
#include "../../core/src/container/Result.h"
#include "../../core/src/container/ResponseAttribute.h"

namespace Xps
{
	TreeItem::TreeItem(XpsAssets::AssetManager* am, int id, ModelItemType type, int pid) : QStandardItem()
	{

		this->type = type;
		this->am = am;
		this->id = id;
		this->pid = pid;
	}

	QVariant TreeItem::data (int role) const
	{
		if (role == Qt::UserRole)
			return id;

		return QStandardItem::data(role);
	}

	void TreeItem::setData ( const QVariant & value, int role)
	{
		QStandardItem::setData(value, role);
	}

	int TreeItem::getID()
	{
		return id;
	}
	
	int TreeItem::getType()
	{
		return (int) type; 
	}
}